<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>{$siteTitle}</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="shortcut icon" href="/favicon.ico" />
        <link rel="stylesheet" href="__PUBLIC__/admin/wx/css/default.css">
        <link href="__PUBLIC__/admin/css/style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="__PUBLIC__/admin/wx/js/jquery-1.6.4.min.js"></script>
        <style>
			.place{height:40px; background:url(__PUBLIC__/admin/images/righttop.gif) repeat-x;}
			.place span{line-height:40px; font-weight:bold;float:left; margin-left:12px;}
			.placeul li{float:left; line-height:40px; padding-left:7px; padding-right:12px; background:url(__PUBLIC__/admin/images/rlist.gif) no-repeat right;}
			.placeul li:last-child{background:none;}
		</style>
    </head>
    <body>
    	<div class="place">
		    <span>位置：</span>
		    <ul class="placeul">
		    <li>首页</li>
		    <li>多图文素材管理</li>
		    </ul>
		</div>
        <div class="col_main">
            <div class="main_bd">
            	<div class="btn_wrp">
                    <a href="{:U('addMoreImgNews')}" class="btn btn_add btn_primary" id="Js_rule_add" data-status="not"><i class="icon14_common add_white"></i>添加多图文</a>
                </div>
                <foreach name="newsImages" item="one_news_image" key="i">
	                <div class="media_preview_area" id="{$one_news_image.news_key}" data-news-id="{$one_news_image.id}">
	                	<div class="appmsg_content" id="keyNews{$one_news_image.id}" style="background-color: #c0c0c0; float: left; width: 292px; height: 199px; position: absolute; z-index: 10000;filter:alpha(opacity=80); -moz-opacity:0.8; opacity:0.8; display: none;"> 
		               		<span style="color: white; font-size: 20px; font-weight: bold; margin: 100px 0px 0px 55px; float: left;">{$one_news_image.news_key}</span>
		               	</div>    
	                    <div class="appmsg multi editing">
	                        <div id="js_appmsg_preview" class="appmsg_content">
	                        	<foreach name="one_news_image.news_detail" item="one_news_article" key="ii">
	                        		<if condition="$ii eq 0">
			                            <div id="appmsgItem1" class="js_appmsg_item ">
			                                <div class="appmsg_info"></div>
			                                <div class="cover_appmsg_item">
			                                    <h4 class="appmsg_title"><a href="javascript:void(0);" onclick="return false;" target="_blank">{$one_news_article.news_title}</a></h4>
			                                    <div class="appmsg_thumb_wrp">
			                                    	<if condition="$one_news_article.news_img_path neq null">
			                                    		<img class="js_appmsg_thumb appmsg_thumb" style="display: block;" src="{$one_news_article.news_img_path}">
			                                    	<else/>
			                                    	 	<i class="appmsg_thumb default">封面图片</i>
			                                    	</if>
			                                    </div>
			                                </div>
			                            </div>
		                            <else />
			                            <div id="appmsgItem2" class="appmsg_item js_appmsg_item ">
			                                <if condition="$one_news_article.news_img_path neq null">
	                                    		<img class="js_appmsg_thumb appmsg_thumb" style="display: block;" src="{$one_news_article.news_img_path}">
	                                    	<else/>
	                                    	 	<i class="appmsg_thumb default">封面图片</i>
	                                    	</if>
			                                <h4 class="appmsg_title"><a onclick="return false;" href="javascript:void(0);" target="_blank">{$one_news_article.news_title}</a></h4>
			                            </div>
		                            </if>
		                        </foreach>
	                        </div>
	                        <div class="appmsg_opr">
		                    	<ul>
		                    		<li class="appmsg_opr_item grid_item size1of2">
		                    			<a href="{:U('editNewsImageMore',array('news_key'=>$one_news_image['news_key']))}">&nbsp;<i class="icon18_common edit_gray">编辑</i></a>
		                    		</li>
		                    		<li class="appmsg_opr_item grid_item size1of2 no_extra">
		            					<a class="js_del no_extra js_tooltip" href="javascript:void(0);" data-news-key="{$one_news_image.news_key}" data-news-img="{$one_news_article.news_img_path}" >&nbsp;<i class="icon18_common del_gray">删除</i></a>
		        					</li>
		                    	</ul>
	                    	</div>
	                    </div>
	                </div>
                </foreach>
                <div class="pagin" style="width: 1000px; float: left; padding-bottom: 50px;">
<!-- 			    	<div class="message">共<i class="blue">{$article_total}</i>条记录，当前显示第&nbsp;<i class="blue">{$page_now}&nbsp;</i>页</div> -->
			       	{$page}
			    </div>
            </div>
        </div>
        <script type="text/javascript">
	        $(function(){
	    		$(".media_preview_area").bind("mouseover", function(){
					var key_id = $(this).attr("data-news-id");
					$("#keyNews"+key_id).show();
	    		});
	    		$(".media_preview_area").bind("mouseout", function(){
					var key_id = $(this).attr("data-news-id");
					$("#keyNews"+key_id).hide();
	    		});
	    		$(".js_del").bind("click", function(){
	    			var news_key = $(this).attr("data-news-key");
	    			var news_image_path = $(this).attr("data-news-img");
	    			if(confirm("您确定要删除该图文信息吗?如果该图文已经配置到微信菜单上,则会推送不出图文信息!")) {
	    				$.get("{:U('ajaxDeleteNewsImage')}",{news_key:news_key,image_path:news_image_path},function(msg){
	        				if(msg==1){
	        					$("#"+news_key).hide();
	        				}else{
	        					alert("删除失败!");
	        				}
	        			});
	    			}
	    		});
	    	});
        </script>
    </body>
</html>